package com.itheima.d5_resource;

import java.io.*;

public class Test3 {
    public static void main(String[] args) {
            try (
                InputStream is = new FileInputStream("D:\\resourse\\th.jpg");
                OutputStream os  = new FileOutputStream("C:\\data\\th2.jpg");

                MyConnection conn =new MyConnection();
                ){
            byte[] bytes = new byte[1024];
            int len;
            while ((len = is.read(bytes)) != -1){
                os.write(bytes, 0, len);
            }
            System.out.println(conn);
            System.out.println("拷贝成功!");
        } catch (IOException e) {
            e.printStackTrace();
        }

    }
}
